home *** CD-ROM | disk | FTP | other *** search
/ Apple Macintosh CD: Power Macintosh 4400 Series / 691-1334-A,B,Power Macintosh 4400 Series. Apple Macintosh CD. (CD).toast / CD Extras / ARA Client Install / Modem CCLs / Prometheus ProModem 144e / Prometheus ProModem 144e next >
Text File  |  1996-05-24  |  7KB  |  371 lines

  1. !  Prometheus ProModem 144e  7/21/93  SDH
  2. !
  3. !  'mlts' resource info for this modem:
  4. !    byte 1 == 01 -> modem HAS builtin reliability protocols
  5. !    byte 2 == 00 -> reserved by Apple
  6. !    byte 3 == 28 -> max hex chars in varstr 7 (40 dec)
  7. !    byte 4 == 28 -> max hex chars in varstr 8
  8. !    byte 5 == 28 -> max hex chars in varstr 9
  9. !
  10. @ORIGINATE
  11. @ANSWER
  12. !
  13. ! set up the modem - label range is 1-10
  14. !
  15. ! Mac talks to the modem at 19,200 bps.
  16. serreset 19200, 0, 8, 1
  17. !
  18. ! reset serial port for hardware options
  19. HSReset 0 0 0 0 0 0
  20. !
  21. settries 0
  22. @LABEL 1
  23. flush
  24. matchclr
  25. matchstr 1 3 "OK\13\10"
  26. ! &f  - recall factory settings
  27. ! &d0 - ignore DTR from DTE
  28. ! e0   - Turn command echo off
  29. ! \n0 - turn off all error control
  30. ! w2 - CONNECT message returns DCE speed
  31. ! y1 - disconnect on long break
  32. ! \k0 - enter command mode but don't send break
  33. ! %e0 - turn off auto retrain
  34. ! \j0 - DTE and DCE may operate independently
  35. write "AT&f&d0e0\\n0w2y1\\k0%e0\\j0\13"
  36. matchread 30
  37. inctries
  38. iftries 2 71
  39. ! Modem is not responding, send a long break
  40. LBreak
  41. jump 1
  42. !
  43. @LABEL 3
  44. ! Modem responding & configured.
  45. ! Determine if reliable link is requested.
  46. !
  47. ! If modem mnp10 link requested (var 4 == 2) then jump label 4
  48. ! If modem v42 link requested (var 4 == 1) then jump label 5
  49. ! If no modem v42 link requested (var 4 == 0) [same as ARA 1.0] then jump label 9
  50. !
  51. ifstr 4 4 "2"
  52. ifstr 4 5 "1"
  53. ifstr 4 9 "0"
  54. !
  55. ! Else invalid value in var 4, exit with error
  56. jump 76
  57. !
  58. !
  59. @LABEL 4
  60. ! Use this label for mnp 10 type stuff...
  61. ! This modem doesn't support mnp 10 links.
  62. jump 7
  63. !
  64. @LABEL 5
  65. ! Reliable link is requested.  OK for LAP-M -> MNP 4.
  66. matchclr
  67. matchstr 1 7 "OK\13\10"
  68. ! \n3 == v42 autoreliable mode
  69. ! %c0 - disables MNP compression
  70. ! "h0 - disables V.42bis compression (\34 in lieu of ")
  71. ! s95 = 77 - enable CONNECT, CARRIER, and PROTOCOL result codes
  72. write "AT\\n3%c0\34h0s95=77\13"
  73. matchread 300
  74. jump 71
  75. !
  76. @LABEL 7
  77. ! If we DID support compression in the modem, this is where it would go.
  78. !
  79. @LABEL 9
  80. ! If speaker on flag is true, jump to label 13.  Else turn off the speaker.
  81. ifstr 2 13 "1"
  82. pause 5
  83. matchclr
  84. matchstr 1 13 "OK\13\10"
  85. write "ATM0\13"
  86. matchread 30
  87. jump 71
  88. !
  89. ! Modem ready, so enable answer or dial mode - label range is 11-30
  90. ! Determine if answer or originate mode.
  91. !
  92. @LABEL 13
  93. pause 5
  94. ifANSWER 62
  95. !
  96. ! Dial type dispatch
  97. !
  98. ! Normal dialing (parm 6 == 0) jump to 19
  99. ! Blind  dialing (parm 6 == 1) jump to 17
  100. ! Manual dialing (parm 6 == 2) jump to 15 
  101. !
  102. ifstr 6 19 "0"
  103. ifstr 6 17 "1"
  104. ifstr 6 15 "2"
  105. !
  106. ! Else invalid value in var 6, exit with error
  107. jump 76
  108. !
  109. @label 15
  110. ASK 2 "Pick up the phone & dial ^1.  Hit OK when the phone rings, then hangup." 80
  111. note "Manual dialing initiated..." 3
  112. ! X1 to ignore dialtone & busy for manual dialing, D to dial
  113. write "ATX1D \13"
  114. jump 32
  115. !
  116. @label 17
  117. note "Dialing without dialtone." 3
  118. matchclr
  119. matchstr 1 19 "OK\13\10"
  120. ! X1 to ignore dialtone & busy for blind dialing
  121. write "ATX1\13"
  122. matchread 30
  123. jump 71
  124. !
  125. ! This is where we break up long dialstrings - label range is 19 - 27.
  126. !
  127. @label 19
  128. ! Parameter 1 contains the full dialstring from the connection document.
  129. ! Parameter 3 contains "P" for pulse & "T" for tone dialing.
  130. ! Parameters 7, 8 & 9 contain the dial string broken up into
  131. ! lengths which the modem's command buffer can handle as defined
  132. ! by the 'mlts' resource.
  133. !
  134. note "Dialing ^1." 3
  135. !
  136. ! If parm 8 is blank goto sending parm 7 only
  137. ! else send parm 7 with semicolon
  138. ifstr 8 25 " "
  139. !
  140. matchclr
  141. matchstr 1 21 "OK\13\10"
  142. write "ATD^3^7;\13"
  143. matchread 400
  144. jump 71
  145. !
  146. ! If parm 9 is blank goto sending param 8
  147. ! else send param 8 with semicolon & param 9
  148. @label 21
  149. ifstr 9 27 " "
  150. !
  151. matchclr
  152. matchstr 1 23 "OK\13\10"
  153. write "ATD^3^8;\13"
  154. matchread 400
  155. jump 71
  156. !
  157. ! Send final parameter string then wait for
  158. ! connect message.
  159. !
  160. @label 23
  161. write "ATD^3^9\13"
  162. jump 32
  163. !
  164. @label 25
  165. write "ATD^3^7\13"
  166. jump 32
  167. !
  168. @label 27
  169. write "ATD^3^8\13"
  170. jump 32
  171. !
  172. !    Connecting - label range is 31-60
  173. !
  174. @LABEL 32
  175. matchclr
  176. matchstr 1  34 "CONNECT 1200\13\10"
  177. matchstr 2  35 "CONNECT 2400\13\10"
  178. matchstr 3  36 "CONNECT 4800\13\10"
  179. matchstr 4  37 "CONNECT 7200\13\10"
  180. matchstr 5  38 "CONNECT 9600\13\10"
  181. matchstr 6  39 "CONNECT 12000\13\10"
  182. matchstr 7  40 "CONNECT 14400\13\10"
  183. ! other connect speeds go below here
  184. matchstr 8  68 "RING\13\10"
  185. matchstr 9  72 "NO DIALTONE\13\10"
  186. matchstr 10 73 "NO CARRIER\13\10"
  187. matchstr 11 73 "ERROR\13\10"
  188. matchstr 12 74 "BUSY\13\10"
  189. matchstr 13 75 "NO ANSWER\13\10"
  190. matchstr 14 77 "MODEM IN USE\13\10"
  191. ! other error messages go below here
  192. matchstr 15 44 "PROTOCOL: NONE\13\10"
  193. matchstr 16 45 "PROTOCOL: ALT\13\10"
  194. matchstr 17 46 "PROTOCOL: LAP-M\13\10"
  195. !
  196. matchread 700
  197. ! If in ANSWER mode, loop back.
  198. ! else if in ORIGINATE, the modem has timed out.
  199. ifANSWER 32
  200. jump 71
  201. !
  202. !  This modem has been setup to do CTS handshaking,
  203. !  and we assume that a CTS handshaking cable is being used,
  204. !  so we leave the serial port set to 19,200 bps.
  205. !
  206. @LABEL 34
  207. note "Communicating at 1200 bps." 2
  208. CommunicatingAt 1200
  209. jump 58
  210. !
  211. @LABEL 35
  212. note "Communicating at 2400 bps." 2
  213. CommunicatingAt 2400
  214. jump 58
  215. !
  216. @LABEL 36
  217. note "Communicating at 4800 bps." 2
  218. CommunicatingAt 4800
  219. jump 58
  220. !
  221. @LABEL 37
  222. note "Communicating at 7200 bps." 2
  223. CommunicatingAt 7200
  224. jump 58
  225. !
  226. @LABEL 38
  227. note "Communicating at 9600 bps." 2
  228. CommunicatingAt 9600
  229. jump 58
  230. !
  231. @LABEL 39
  232. note "Communicating at 12000 bps." 2
  233. CommunicatingAt 12000
  234. jump 58
  235. !
  236. @LABEL 40
  237. note "Communicating at 14400 bps." 2
  238. CommunicatingAt 14400
  239. jump 58
  240. !
  241. ! Reliable link connections.
  242. ! Tell ARA with USERHOOK 2 that a modem reliable link has been established.
  243. !
  244. @LABEL 44
  245. jump 32
  246. !
  247. @LABEL 45
  248. note "MNP reliable link established." 3
  249. userhook 2
  250. jump 32
  251. !
  252. @LABEL 46
  253. note "LAP-M reliable link established." 3
  254. userhook 2
  255. jump 32
  256. !
  257. ! Carrier (dce) connections.
  258. !
  259. @LABEL 50
  260. note "Carrier at 14400 bps." 3
  261. jump 32
  262. !
  263. @LABEL 58
  264. ! set serial port for hardware CTS handshake
  265. HSReset 0 1 0 0 0 0
  266. !
  267. ! Connection established. In ORIGINATE mode pause before exit.
  268. !
  269. ifANSWER 59
  270. pause 30
  271. @LABEL 59
  272. exit 0
  273. !
  274. ! @ANSWER
  275. ! Set the modem to answer on 1st ring - label range is 61-70
  276. !
  277. @LABEL 62
  278. matchclr
  279. matchstr 1 32 "OK\13\10"
  280. write "ATS0=1\13"
  281. matchread 30
  282. jump 71
  283. !
  284. ! RING entry point
  285. ! If originate mode return to waiting for input.
  286. ! Else claim the serial port and return.
  287. !
  288. @LABEL 68
  289. ifORIGINATE 32
  290. userhook 1
  291. note "Answering call..." 2
  292. jump 32
  293. !
  294. ! Error messages - label range is 71-100
  295. !
  296. ! Modem Not Responding
  297. @LABEL 71
  298. exit -6019
  299. !
  300. ! No Dial Tone
  301. @LABEL 72
  302. exit -6020
  303. !
  304. ! No Carrier or Error
  305. @LABEL 73
  306. exit -6021
  307. !
  308. ! Busy
  309. @LABEL 74
  310. exit -6022
  311. !
  312. ! No Answer
  313. @LABEL 75
  314. exit -6023
  315. !
  316. ! Invlaid Varstring Value
  317. @LABEL 76
  318. exit -6027
  319. !
  320. ! Modem in Use
  321. @LABEL 77
  322. exit -6002 "Modem is in use by another application"
  323. !
  324. @LABEL 80
  325. exit -6008
  326. !
  327. ! Hang up the modem - label range is 101-120
  328. !
  329. @HANGUP
  330. @LABEL 102
  331. flush
  332. settries 0
  333. HSReset 0 0 0 0 0 0
  334. @LABEL 105
  335. !
  336. ! Repeat hangup command and escape sequence 3 times max.
  337. !
  338. @LABEL 108
  339. pause 10
  340. matchclr
  341. matchstr 1 111 "NO CARRIER\13\10"
  342. matchstr 2 111 "OK\13\10"
  343. matchstr 3 111 "ERROR\13\10"
  344. write "ATH\13"
  345. matchread 30
  346. inctries
  347. iftries 3 71
  348. ! no response, try escape sequence
  349. matchclr
  350. matchstr 1 108 "OK\13\10"
  351. pause 11
  352. write "+++"
  353. pause 11
  354. matchread 15
  355. jump 105
  356. !
  357. ! Recall the factory settings.
  358. !
  359. @LABEL 111
  360. pause 15
  361. matchclr
  362. matchstr 1 114 "OK\13\10"
  363. write "AT&f\13"
  364. matchread 30
  365. jump 71
  366. !
  367. @LABEL 114
  368. exit 0
  369. !
  370. ! Labels 121-128 are reserved for future emergency hacks
  371. !